<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src="__PUBLIC__/js/jquery.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/shopping.js"></script>
<link href="__PUBLIC__/css/base.css" type="text/css" rel="stylesheet" />
<link href="__PUBLIC__/css/main.css" type="text/css" rel="stylesheet" />


<style>
/*demo css*/
.i_tips {
	height: 30px;
	margin-left: 20px;
	color: #f60;
	font-size: 14px;
	line-height: 30px
}

.i_box {
	margin: 10px 20px;
	font-size: 14px;
	float: left
}

.i_box * {
	vertical-align: middle
}

.i_box a {
	padding: 2px 5px;
	background-color: #e9e9e9;
	border: 1px solid #ccc;
	text-decoration: none;
	color: #585858;
	line-height: 20px
}

.i_box a:hover {
	color: #000
}

.i_box input {
	width: 30px;
	height: 18px;
	margin: 0 8px;
	padding: 2px;
	border: 1px solid #ccc;
	text-align: center;
	line-height: 16px
}
</style>

</head>
<body>

		<script type="text/javascript">
			$(document).ready(function(){
				/*
			  	$('#searcProduct').focusout(function(){				  	
				  	$('#searcProduct').val('请输入您要查询的产品名称');
			  	});*/				  
			});

			function kkk(){
				window.location = "__APP__/ProductShow/search/name/"+$('#searcProduct').val();	
			}
		</script>
		

		<div id="header" class="w980 posnR clear">
		<div class="fRight p5" style="width:600px;">
		<?php if(isset($_SESSION[C('USER_AUTH_KEY')])): ?><a href="__APP__/User/loginout/" class="orange fRight mR10">安全退出</a><a href="__APP__/ShoppingCart/" class="orange fRight mR10"><span class="mainbg block fLeft" style="background-position:-263px 2px; width:14px;height:14px;margin-right:3px;"></span>查看购物车</a><a href="__APP__/UserCenter/" class="orange fRight mR10"><span class="mainbg block fLeft" style="background-position:-234px 2px; width:14px;height:14px;margin-right:3px;"></span>用户中心</a> <span class="fRight">您好，<?php echo ($_SESSION[C('USER_AUTH_KEY')]); ?> 欢迎访问万州特色农产品网！ </span>&nbsp;&nbsp;
				
				
				
			<?php else: ?> 
				<a href="__APP__/User/register/" class="orange fRight mR10"><span class="mainbg block fLeft" style="background-position:-249px 2px; width:14px;height:14px;margin-right:3px;"></span>免费注册</a><a href="__APP__/User/login/" class="orange fRight mR10"><span class="mainbg block fLeft" style="background-position:-234px 2px; width:14px;height:14px;margin-right:3px;"></span>登陆</a> <span class="fRight">欢迎访问万州特色农产品网！您还未登录！</span>&nbsp;&nbsp;<?php endif; ?> 
		</div>
			
  			<div class="posnA" style="top:80px; left:290px;">
    			<input type="text" id="searcProduct" class="search-input mainbg fontGray9" value="请输入您要查询的产品名称" onclick="this.value='';focus()"/>
    			<button class="search-submit mainbg" type="submit" onclick="kkk();">搜索</button>
  			</div>
  			<!-- 
  			<div class="posnA" style="top:138px; left:300px;">
  				<a href="error.html">礼盒</a> | 
  				<a href="error.html">有机大米</a> | 
  				<a href="error.html">有机杂粮</a> | 
  				<a href="error.html">枣</a> | 
  				<a href="error.html">食用菌</a> | 
  				<a href="error.html">蛋</a> | 
  				<a href="error.html">肉</a>
  			</div>
  			 -->
  			<div class="posnA line30" style="right:16px; bottom:16px; color:#fe4e00; font-family:Microsoft YaHei; font-size:30px;"><em>400-000-0000</em></div>
		</div>
		
		<div id="nav" class="w980 font14 clear">
  			<ul>
    			<li class="cut"><a href="__APP__/Index">首页</a></li>
    			<li><a href="__APP__/ProductShow">产品展示</a></li>
    			<li class="cut"><a href="__APP__/News">新闻动态</a></li>
    			<li><a href="__APP__/WebSiteShow/detail/code/jdfc">基地风采</a></li>
    			<li><a href="__APP__/WebSiteShow/detail/code/ryrz">荣誉认证</a></li>
    			<li><a href="__APP__/WebSiteShow/detail/code/gywm">关于我们</a></li>
    			<li><a href="__APP__/WebSiteShow/detail/code/lxwm">联系我们</a></li>
  			</ul>
  			<span class="font12 mainbg block fRight" style="width:195px;height:21px; background-position:0 -120px;padding-left:30px;padding-top:4px;">购物车有&nbsp;<strong class="orange">155</strong>&nbsp;件商品&nbsp;|&nbsp;<a href="__APP__/ShoppingCart/" class="orange">去结算</a></span>
		</div>




<div class="w980 clear mT10 p20">
<p class="font18 fontYH line24 lineB w90auto pTB5 mB20"><span class="mainbg block fLeft" style="background-position:-425px -120px; width:26px;height:25px;margin-right:3px;"></span>我的购物车<span class="font12 fontnormal mL10"><a href="#">×清空购物车</a></span></p>
<form action="__URL__/shoppingOrder" method="post">
<table border="0" class="w90auto lineBorder" cellpadding="5" cellspacing="1">
<tbody>
	<tr>
		<th class="p10 white" bgcolor="#777777">序号</th>
		<th class="p10 white" bgcolor="#777777">商品</th>
		<th class="p10 white" bgcolor="#777777">名称</th>
		<th class="p10 white" bgcolor="#777777">重量</th>
		<th class="p10 white" bgcolor="#777777">单价</th>
		<th class="p10 white" bgcolor="#777777">数量</th>
		<th class="p10 white" bgcolor="#777777">小计</th>
		<th class="p10 white" bgcolor="#777777">操作</th>
	</tr>
	
	
	<?php if(is_array($list)): $k = 0; $__LIST__ = $list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): ++$k;$mod = ($k % 2 )?><tr >
								
	    <td valign="middle" align="center" class="p10"><input type="hidden" style="float:left;width:2px;" name="andy[]" value="<?php echo ($vo['id']); ?>" /><span id="number<?php echo ($k); ?>"><label><?php echo ($vo['id']); ?></label></span></td>			
			<td valign="middle" align="center" class="p10">iamgeurl</td>
			<td valign="middle" class="p10"><a href="#" class="orange"><?php echo ($vo['name']); ?></a></td>
			<td valign="middle" align="center" class="p10">weight</td>
			<td valign="middle" align="center" class="p10"><span id="price<?php echo ($k); ?>"><?php echo ($vo['local_price']); ?></span></td>			
			<td valign="middle" align="center" class="p10"><a href="javascript:;" class="J_minus">-</a>
			<?php echo ($vo['quantity']); ?><input type="text" id="quantity<?php echo ($k); ?>" value="<?php echo ($vo['quantity']); ?>" class="J_input"  style="width:60px;"/><a href="javascript:;"
			class="J_add">+</a></td>
			<td valign="middle" align="center" class="p10"><span id="lumpsum<?php echo ($k); ?>"><?php echo ($vo['lumpsum']); ?></span></td>
			<td valign="middle" align="center" class="p10"><a href="__URL__/deleteShoppingCart/id/<?php echo ($vo['id']); ?>" class="orange">删除</a></td>
		</tr><?php endforeach; endif; else: echo "" ;endif; ?>
<tr>
<td colspan="8" class="p10 lineB lineT" align="right">产品数量总计：<span class="orange">9</span> 件 产品金额总计：￥<span class="orange"> 607.00</span></td>
</tr>
<tr>
<td colspan="8" class="p10 " align="right"><a href="#" class="p5 orange mR10">&laquo;&nbsp;继续购物</a><input class="p5 bgOrange white border-s-Orange mR10" style="cursor:pointer;border:0;" border="0" type="submit" value="&nbsp;去结算&nbsp; "/> </td>
</tr>
</tbody>
</table>


</form></div>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">


<div class="w978 borderGreen mT10 line20">
<table border="0" class="w95auto pTB10">
  <tr>
    <td valign="top" class="p5" align="right"><img src="__PUBLIC__/images/gw.gif"/></td>
    <td valign="top" class="p5"><p><strong>购物指南</strong></p>
<ul>
<li><a href="__APP__/WebSiteShow/detail/code/gwlc">购物流程</a></li>
<li><a href="__APP__/WebSiteShow/detail/code/cjwt">常见问题</a></li>
<li><a href="__APP__/WebSiteShow/detail/code/lxkf">联系客服</a></li></ul></td>
    <td valign="top" class="p5" align="right"><img src="__PUBLIC__/images/ps.gif"/></td>
    <td valign="top" class="p5"><p><strong>配送方式</strong></p>
<ul>
<li><a href="__APP__/WebSiteShow/detail/code/smzt">上门自提</a></li>
<li><a href="__APP__/WebSiteShow/detail/code/kdys">快递运输</a></li>
</ul></td>
    <td valign="top" class="p5" align="right"><img src="__PUBLIC__/images/zf.gif"/></td>
    <td valign="top" class="p5"><p><strong>支付方式</strong></p>
<ul>
<li><a href="__APP__/WebSiteShow/detail/code/hdfk">货到付款</a></li>
<li><a href="__APP__/WebSiteShow/detail/code/zxzf">在线支付</a></li>
<li><a href="__APP__/WebSiteShow/detail/code/yjhk">邮局汇款</a></li>
<li><a href="__APP__/WebSiteShow/detail/code/gszz">公司转账</a></li></ul></td>
    <td valign="top"  class="p5" align="right"><img src="__PUBLIC__/images/sh.gif"/></td>
<td valign="top" class="p5"><p><strong>售后服务</strong></p>
<ul>
<li><a href="__APP__/WebSiteShow/detail/code/thhzc">退换货政策</a></li>
<li><a href="__APP__/WebSiteShow/detail/code/thhlc">退换货流程</a></li>
<li><a href="__APP__/WebSiteShow/detail/code/tksm">退款说明</a></li>
<li><a href="__APP__/WebSiteShow/detail/code/tksq">退款申请</a></li>
</ul></td>
  </tr>
</table>
<table border="0" class="w90auto lineBorder bgGray p10 mB10 font14 fontGray6 fontYH">
  <tr>
    <td align="center"><span class="orange font16">价廉物美</span>&nbsp;正品又便宜</td>
    <td align="center"><img src="__PUBLIC__/images/ysbg.gif"/></td>
    <td align="center"><span class="orange font16">价廉物美</span>&nbsp;正品又便宜</td>
    <td align="center"><img src="__PUBLIC__/images/ysbg.gif"/></td>
    <td align="center"><span class="orange font16">价廉物美</span>&nbsp;正品又便宜</td>
  </tr>
</table>

</div>
<div class="w980 clear mT10 line22" align="center">
	<a href="__APP__/AboutUs">关于我们</a> | 
	<a href="__APP__/TransMe">联系我们</a> | 
	<a href="__APP__/KindsOfPay">购物流程</a> | 
	<a href="__APP__/PayType">支付方式</a> | 
	<a href="">人才招聘</a> | 
	<a href="">友情链接</a> <br/>
  ©2008-2010 万州特色农产品网 版权所有<br />
  <img src="__PUBLIC__/images/kxwz.jpg"/>&nbsp;&nbsp;
  <img src="__PUBLIC__/images/gawj.jpg"/>&nbsp;&nbsp;
  <img src="__PUBLIC__/images/bljb.jpg"/>
</div>


		<script language="JavaScript">
			//调用			
			
			function kkk(){
				console.log((jQuery('span label')));				
				$("span label").each(function(i,n){					
					alert($(this).html()) ;										
				});
				
				window.location = "__URL__/shoppingOrder";
				
			}
			
			
			$(document).ready(function(){
				//总计
				var l = "lumpsum" ;
				//单价
				var p = "price" ;
				//数量
				var q = "quantity" ;
				//序号
				var n = "number" ;
				for ( var i = 1 ; i <= <?php echo ($shoppingCount); ?> ; i++){
					$('#lumpsum').html(  $('#price').html() * $('#quantity').val() );		
					document.getElementById(l+i).innerHTML = 
						document.getElementById(p+i).innerHTML * document.getElementById(q+i).value ;					
				}
			  	$('.i_box').iVaryVal({
				  	Fun:function(){
					$('.i_tips').html('你点击的表单索引是：'+$GLOBAL.index+'；改变后的表单值是：'+$GLOBAL.val);					
					//$('#lumpsum').html(  $('#price').html() * $('#quantity').val() );
					var j = $GLOBAL.index + 1 ;
					//ajax调用
					document.getElementById(l+j).innerHTML = 
						document.getElementById(p+j).innerHTML * document.getElementById(q+j).value ;
						
					$.post('__URL__/updateShoppingCart',
				    	    {	
					    	    'id':document.getElementById(n+j).innerHTML,
					    	    'quantity':document.getElementById(q+j).value,
					    	    'lumpsum':document.getElementById(l+j).innerHTML			    	    		    		
					    	},
							    function(data){
									//alert(data.info);					
							    },
					'json');
					
				}});	
			});

		</script>

</body>
</html>